<template>
    <el-dialog
      :title="title"
      :visible.sync="showConfirm"
      :show-close="false"
      width="30%">
      <span slot="footer" class="dialog-footer">
        <el-button @click="onCloseConfirm">取 消</el-button>
        <el-button type="primary" @click="onClickSubmit" :loading="loading">{{ loading ? '提交中 ...' : '确 定' }}</el-button>
      </span>
    </el-dialog>
</template>
<script>
export default {
    props: ["title", "showConfirm"],
    data() {
        return {
            loading: false
        };
    },
    methods: {
        onCloseConfirm() {
            this.$emit('closeConfirm');
        },
        onClickSubmit() {
            // 点击确定，触发父组件的 提交操作
            this.$emit('submitConfirm');
        }
    }
}
</script>